// run: $exec < input
#include <iostream>
#include <iomanip>
#include <vector>

int const maxn = 100007;
int size[maxn];
int father[maxn];
double exp[maxn];
std::vector<std::vector<int>> tree;
int n;

void add_edge(int u, int v)
{
	tree[u].push_back(v);
	tree[v].push_back(u);
}

void dfs(int u, int f)
{
	int s = 1;
	for (auto v : tree[u]) {
		if (v == f) continue;
		dfs(v, u);
		s += size[v];
	}
	size[u] = s;
}

void dp(int u, int f)
{
	for (auto v : tree[u]) {
		if (v == f) continue;
		exp[v] = exp[u] + (size[u] - size[v] - 1) / 2.0 + 1;
		dp(v, u);
	}
}

int main()
{
	std::ios::sync_with_stdio(false);
	std::cin >> n;
	tree.resize(n + 1);
	for (int i = 1; i < n; i++) {
		int x; std::cin >> x;
		father[i + 1] = x;
		add_edge(x, i + 1);
	}
	dfs(1, 0);
	exp[1] = 1;
	dp(1, 0);
	for (int i = 1; i <= n; i++) std::cout << std::fixed << std::setprecision(8) << exp[i] << " ";
}

